home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9898 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  31 lines

  1. Path: chronicle.mti.sgi.com!news
  2. From: austern@isolde.mti.sgi.com (Matt Austern)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: C code in a C++ app
  5. Date: 05 Mar 1996 02:28:49 GMT
  6. Organization: SGI
  7. Message-ID: <AUSTERN.96Mar4182849@isolde.mti.sgi.com>
  8. References: <4h7t43$6as@frodo.smartlink.net> <Dnr5sw.KIn@doc.ntu.ac.uk>
  9. Reply-To: austern@mti.sgi.com
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. In-reply-to: CHAMBERS Jason's message of Mon, 4 Mar 1996 16:58:08 GMT
  12.  
  13. In article <Dnr5sw.KIn@doc.ntu.ac.uk> CHAMBERS Jason <pt3chaj> writes:
  14.  
  15. > You should be able to compile C code using a C++ compiler. This stems from the
  16. > early days where C++ compilers essentially converted its input to C source, to
  17. > be passed to the C compiler. Maybe, the compilation errors you are getting are
  18. > due to non-portable code and nothing to do with the fact that you are compiling
  19. > using a C++ compiler.
  20.  
  21. Not quite.  C++ is almost compatible with C (As Bjarne Stroustrup
  22. points out, every program in K&R II is a legal C++ program), but only
  23. almost.
  24.  
  25. As a trivial example, the program "int main() { int class; return 0; }"
  26. is legal C, but not legal C++.
  27. -- 
  28. Matt Austern
  29. SGI: MTI Compilers Group
  30. austern@isolde.mti.sgi.com
  31.